package com.example.day05;
import java.util.Scanner;

public class Addition {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int score = 0;
        for (int i = 1;i<=10;i++){
//            出题
            int a = (int)(Math.random()*100);
            int b = (int)(Math.random()*100);
            int result = a + b;
            System.out.println("("+i+")"+a+"+"+b+"=?");
//            答题
            System.out.println("猜吧");
            int answer = scan.nextInt();
//            判题
            if(answer==result){
                System.out.println("恭喜您，回答正确！！！");
                score += 10;
            }else{
                System.out.println("很遗憾，回答错误");
            }
        }
        System.out.println("总分为："+score);
    }
}
